package main.java.net;

import java.io.IOException;
import java.io.OutputStream;

/* 客户端 */
public class NetClient {
    public static void main(String[] args) throws IOException {
        //构建Socket对象与服务器建立连接
        java.net.Socket socket = new java.net.Socket("127.0.0.1",6666);
        //获取网络输出流
        OutputStream outputStream = socket.getOutputStream();
        //向服务端写数据
        outputStream.write(1);
    }
}
